package interpreter.bytecodes.debuggerByteCodes;

import interpreter.VirtualMachine;
import interpreter.bytecodes.LitByteCode;
import interpreter.debugger.DebugVirtualMachine;


/**
 *
 * @author Kris Selbekk
 */
public class DebugLitCode extends LitByteCode {

    public void exec( VirtualMachine vm ) {
        super.exec((DebugVirtualMachine) vm); // Casting

        // Adds lit code and its name (if any) to the function env record
        String[] arguments = getArgs().toString().split("\\s");
        String second = "";
        if( arguments.length == 2 ) second = arguments[1];
        
        ((DebugVirtualMachine) vm).enterSymbol(second, Integer.parseInt(arguments[0]) );

    }
}
